<template>
  <button type="button" @click="onClickAge">Update Age</button>
  <p>The usr is {{age}} years old</p>
  <p>{{ ageDoubled }}</p>
</template>

<script>
export default {
    name:"User",
    props:["age"],
    emits:['age-change'],
    computed:{
      ageDoubled(){
        return this.age*2
      }
    },
    methods: {
      onClickAge(){
        this.$emit('age-change')
      }
    },
}
</script>

